package com.atmilan.quartz.constant.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 商品同步状态流
 * @Description: 
 * @author daigb
 * @date 2021-03-15
 */
public enum SyncStatusEnum implements IEnum<Integer> {
    /**
     * 处理中
     */
    WAIT(0, "处理中"),
    
    /**
     * 下发完成
     */
    SYNC(1, "下发完成"),
    
    /**
     * 同步完成
     */
    PUSH(2, "同步完成"),
    
    ;

    private Integer code;
    private String msg;

    SyncStatusEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static SyncStatusEnum valueOf(Integer code) {
        for (SyncStatusEnum value : values()) {
            if (value.getCode() == code) {
                return value;
            }
        }
        
        return null;
    }
    
    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    @Override
    @JsonValue
    public Integer getValue() {
        return code;
    }

}
